package com.fsc.monitor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
import com.alibaba.fastjson.JSON;
import de.codecentric.boot.admin.config.EnableAdminServer;
//import de.codecentric.boot.admin.server.config.EnableAdminServer;
//import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping;

/**
* @comments
* @author  zg
* @date 2018年9月3日
*/
@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@EnableAdminServer
public class MicroSrvMonitorApplication {
	private static Class<?> cla = MicroSrvMonitorApplication.class;
	private static final Logger logger = LoggerFactory.getLogger(cla);
	
	public static void main(String[] args) {
		logger.info("args:{}", JSON.toJSONString(args));
		ConfigurableApplicationContext cofigAppCont = SpringApplication.run(cla, args);
		ConfigurableEnvironment confEnv = cofigAppCont.getEnvironment();
		//String host = confEnv.getProperty("eureka.instance.hostname");
		String port = confEnv.getProperty("server.port");
		
		logger.info("MicroSrvMonitorApplication started on {} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", port);
	}
}
